/*
 * @Description: 线路接口
 * @Author: Liu Zhiwang
 * @Date: 2021-03-03 14:59:12
 * @LastEditTime: 2021-09-09 14:57:48
 * @LastEditors: Liu Zhiwang
 */
import request from '@/utils/request'

// 线路（不分页）
export function getListPage(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/jcSecline/getSeclineTree') : '/jcwBasicgz/jcSecline/getSeclineTree',
    method: 'GET',
    params: params
  })
}

// 添加/编辑
export function updateData(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/jcSecline/saveOrUpdateData') : '/jcwBasicgz/jcSecline/saveOrUpdateData',
    method: 'POST',
    data: params
  })
}

// 删除
export function deleteData(query) {
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/jcSecline/' + query.id) : `/jcwBasicgz/jcSecline/${query.id}`,
    method: 'DELETE'
  })
}

// 字典
export function getDict(query) {
  var params = JSON.parse(JSON.stringify(query))
  delete params.unitCodeParams
  return request({
    url: query.unitCodeParams ? ('/jcwBasic' + query.unitCodeParams + '/jcSecline/getDict') : `/jcwBasicgz/jcSecline/getDict`,
    method: 'GET',
    params: params
  })
}
